direction = int(input())
straight,left,right = map(int,input().split())
if direction == 1:
    if straight == 0:
        print('wait')
    elif straight == 1:
        print('pass')
elif direction == 2:
    print('wait')
elif direction == -1:
    if left == 0:
        print('wait')
    elif left == 1:
        print('pass')
elif direction == -2:
    if right == 0:
        print('wait')
    elif right == 1:
        print('pass')